<template>
  <view class="container">
    <view class="test-list">
      <view class="test-item" v-for="(test, index) in tests" :key="index" @click="goToTest(test.id)">
        <image :src="test.image" mode="aspectFill" class="test-image"></image>
        <view class="test-info">
          <text class="test-title">{{test.title}}</text>
          <text class="test-desc">{{test.description}}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      tests: [
        {
          id: 1,
          title: '抑郁症筛查量表',
          description: '用于评估抑郁症状的严重程度',
          image: '/static/test1.png'
        },
        {
          id: 2,
          title: '焦虑自评量表',
          description: '评估焦虑程度的自评量表',
          image: '/static/test2.png'
        },
        {
          id: 3,
          title: '压力测试量表',
          description: '评估当前压力水平',
          image: '/static/test3.png'
        }
      ]
    }
  },
  methods: {
    goToTest(testId) {
      uni.navigateTo({
        url: '/pages/userInfo/testSelect'
      })
    }
  }
}
</script>

<style>
.container {
  padding: 20rpx;
}
.test-list {
  display: flex;
  flex-direction: column;
  gap: 30rpx;
}
.test-item {
  background-color: #ffffff;
  border-radius: 12rpx;
  overflow: hidden;
  box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.1);
}
.test-image {
  width: 100%;
  height: 300rpx;
}
.test-info {
  padding: 20rpx;
}
.test-title {
  font-size: 32rpx;
  font-weight: bold;
  margin-bottom: 10rpx;
  display: block;
}
.test-desc {
  font-size: 28rpx;
  color: #666;
}
</style> 